package chapter11;

import java.util.PriorityQueue;
import java.util.Random;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/9 18:05
 */
public class PirorityQueueTest {
    public static void main(String[] args) {
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        Random random = new Random(47);
        for (int i = 0; i < 10; i++) {
            priorityQueue.offer(random.nextInt(i + 10));
        }
        System.out.println(priorityQueue);
        while (priorityQueue.peek() != null) {
            System.out.println(priorityQueue.poll());
        }
    }
}
